package com.knight.listener;


import com.knight.EventHandlerPool;
import com.knight.handler.EventHandler;
import com.knight.message.EventDate;

import java.util.List;

/**
 * 简单监听器，处理方式为同步处理
 * @param <E>
 * @param <T>
 */
public class SimpleEventListener<E,T> extends AbstractEventListener {


    public SimpleEventListener(EventHandlerPool eventHandlerPool) {
        super(eventHandlerPool);
    }

    @Override
    void handleEventDate(List eventHandlerList, EventDate eventDate) {
        for(Object o : eventHandlerList) {
            EventHandler eventHandler = (EventHandler)o;
            eventHandler.handler(eventDate);
        }
    }
}
